package com.imay.live.helper;

import android.net.Uri;
import android.text.TextUtils;

import com.imay.live.BuildConfig;

import java.util.List;

/**
 * Created by jeaman on 2017/3/31.
 */

public class UrlHelper {
    //SCHEME
    public final static String SCHEME = "m.imay.com";
    public final static String HOST = "com.imay.live";

    private static final String DOMAIN = "https://www.imay.cn";
    private static final String SOCKET_DOMAIN = "gate.imay.com";
    private static final String API_DOMAIN = "http://appapi.imay.com";
    private static final String SHARE_DOMAIN = "https://m.imay.com";

    private static final String TEST_SOCKET_DOMAIN = "test.gate.imay.com";
    private static final String TEST_API_DOMAIN = "http://test.gate.imay.com";
    private static final String TEST_SHARE_DOMAIN = "http://dev.m.imay.com";//https://testm.imay.com/

    public static final String LIVE_LICENSE = DOMAIN + "/about/greenLive.html";
    public static final String SIGN_LICENSE = DOMAIN + "/about/brokerService.html";
    public static final String RECHARGE_LICENSE = DOMAIN + "/about/recharge.html";
    public static final String KEY_DOMAIN = "key_domain";

    public static final String URL = "https://www.imay.cn/about/privacyService.html";
    public static final String DEVURL = "http://dev.www.imay.com/about/privacyService.html";

    private static String sTestApiDomain;
    private static String sTestSocketDomain;

    private static final String getApiDomain() {
        if (BuildConfig.IS_RELEASE) {
            return API_DOMAIN;
        } else {
            if (sTestApiDomain == null) {
                sTestApiDomain = PreferenceHelper.getInstance().getApiDomain(TEST_API_DOMAIN);
            }
            return sTestApiDomain;
        }
    }

    public static void setTestApiDomain(String domain) {
        sTestApiDomain = domain;
        PreferenceHelper.getInstance().saveApiDomain(domain);
    }

    public static final String getTestSocketDomain() {
        if (sTestSocketDomain == null) {
            sTestSocketDomain = PreferenceHelper.getInstance().getSocketDomain(TEST_SOCKET_DOMAIN);
        }
        return sTestSocketDomain;
    }

    public static void setTestSocketDomain(String domain) {
        sTestSocketDomain = domain;
        PreferenceHelper.getInstance().saveSocketDomain(domain);
    }

    private static String getShareDomain() {
        if (BuildConfig.IS_RELEASE) {
            return SHARE_DOMAIN;
        } else {
            return TEST_SHARE_DOMAIN;
        }
    }

    //App激活
    public static String getAppActivationUrl() {
        return getApiDomain() + "/v2/info/appactivation";
    }

    public static String getTokenUrl(String bucket) {
        return getApiDomain() + "/v2/vendor/qiniu/getToken?bucket=" + bucket;
    }

    public static String getLoginUrl() {
        return getApiDomain() + "/v2/account/login/phone";
    }

    public static String getSmsUrl() {
        return getApiDomain() + "/v2/account/sendSms";
    }

    public static String getLoginQQUrl() {
        return getApiDomain() + "/v2/account/login/qq";
    }

    public static String getWechatUrl() {
        return getApiDomain() + "/v2/account/login/wechat";
    }

    public static String getWBUrl() {
        return getApiDomain() + "/v2/account/login/weibo";
    }

    public static String getCheckSmsUrl() {
        return getApiDomain() + "/v2/account/checkSms";
    }

    public static String getcheckOnlineUrl(String phoneCountry, String phone, String accessCode) {
        return getApiDomain() + "/v2/account/checkOnline?phoneCountry=" + phoneCountry + "&phone=" + phone + "&accessCode=" + accessCode;
    }


    public static String getResetPsdUrl() {
        return getApiDomain() + "/v2/account/resetPassword";
    }

    public static String getCheckNickUrl() {
        return getApiDomain() + "/v2/account/checkNick";
    }

    public static String getDynamicsFeeds(int beforeTime, int maxId, int count) {
        return getApiDomain() + "/v2/feed/list/home?beforeTime=" + beforeTime + "&maxId=" + maxId + "&count=" + count;
    }

    public static String getFeedCreateUrl() {
        return getApiDomain() + "/v2/feed/create";
    }

    public static String getLabelCreateFeedSuggestUrl() {
        return getApiDomain() + "/v2/discover/label/feedSuggest";
    }

    public static String getRelationFollowsUrl(int start, int count) {
        return getApiDomain() + "/v2/user/relation/follows?start=" + start + "&count=" + count;
    }

    public static String getFeedCommentListUrl(int feedId, int sinceId, int maxId, int count) {
        return getApiDomain() + "/v2/feed/comment/list?feedId=" + feedId + "&sinceId=" + sinceId + "&maxId=" + maxId + "&count=" + count;
    }

    public static String getLikeCreate() {
        return getApiDomain() + "/v2/feed/like/create";
    }

    public static String getLikeDel() {
        return getApiDomain() + "/v2/feed/like/del";
    }

    /**
     * 删除动态
     *
     * @return
     */
    public static String getFeedDelUrl() {
        return getApiDomain() + "/v2/feed/delete";
    }

    /**
     * 编辑动态
     *
     * @return
     */
    public static String getFeedModifyUrl() {
        return getApiDomain() + "/v2/feed/modify";
    }

    public static String getCommentCreateUrl() {
        return getApiDomain() + "/v2/feed/comment/create";
    }

    public static String getCommentDelUrl() {
        return getApiDomain() + "/v2/feed/comment/del";
    }

    public static String getCoverGirlsUrl() {
        return getApiDomain() + "/v2/info/coverGirls";
    }

    public static String getLabelRelatedUrl(String label) {
        return getApiDomain() + "/v2/discover/label/related?label=" + Uri.encode(label);
    }

    public static String getLabelNewestUrl(String label, int sinceId, int maxId, int count) {
        return getFeedTopicUrl(label, sinceId, maxId, count, false);
    }

    //获取推流地址
    public static String getStreamInfoUrl() {
        return getApiDomain() + "/v2/room/streamInfo";
    }

    //获取主播设备信息
    public static String getRoomDeviceInfoUrl(long roomId) {
        return getApiDomain() + "/v2/room/deviceInfo?roomId=" + roomId;
    }

    //获取举报地址
    public static String getReportUrl() {
        return getApiDomain() + "/v2/discover/report";
    }

    public static String getRegisterUrl() {
        return getApiDomain() + "/v2/account/create";
    }

    public static String getChangePasswordUrl() {
        return getApiDomain() + "/v2/account/changePassword";
    }

    public static String getUserInfoUrl(long userId) {
        if (userId != 0) {
            return getApiDomain() + "/v2/user/info?targetUid=" + userId;
        } else {
            return getApiDomain() + "/v2/user/info";
        }
    }

    public static String getDiscoverlabelUrl(int type) {
        return getApiDomain() + "/v2/discover/label/hot?type=" + type;
    }

    public static String getSuggestUrl() {
        return getApiDomain() + "/v2/discover/label/suggest";
    }

    //开播标签列表
    public static String getLiveSuggestUrl() {
        return getApiDomain() + "/v2/discover/label/roomSuggest";
    }

    // 获取热门房间
    public static String getRoomSuggestUrl(int start, int count) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getApiDomain());
        stringBuilder.append("/v2/discover/room/suggest");
        stringBuilder.append("?start=");
        stringBuilder.append(start);
        stringBuilder.append("&count=");
        stringBuilder.append(count);
        return stringBuilder.toString();
    }

    // 获取超胆播视频列表
    public static String getShortLiveUrl(int start, int count) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getApiDomain());
        stringBuilder.append("/v2/discover/shortLive/topics");
        stringBuilder.append("?start=");
        stringBuilder.append(start);
        stringBuilder.append("&count=");
        stringBuilder.append(count);
        return stringBuilder.toString();
    }

    // 获取超胆播挑战统计数据
    public static String getShortLiveStatUrl() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getApiDomain());
        stringBuilder.append("/v2/discover/shortLive/stat");
        return stringBuilder.toString();
    }

    // 获取超胆播挑战详细信息
    public static String getShortLiveDetailUrl(int start, int count, int challengeId, int type) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getApiDomain());
        stringBuilder.append("/v2/discover/shortLive/detail");
        stringBuilder.append("?start=");
        stringBuilder.append(start);
        stringBuilder.append("&count=");
        stringBuilder.append(count);
        stringBuilder.append("&challengeId=");
        stringBuilder.append(challengeId);
        stringBuilder.append("&type=");
        stringBuilder.append(type);
        return stringBuilder.toString();
    }

    public static String getHotImayUrl() {
        return getApiDomain() + "/v2/discover/user/hot";
    }

    public static String getHotImayMoreUrl(String hotType) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getApiDomain());
        stringBuilder.append("/v2/discover/user/hot/more");
        stringBuilder.append("?hotType=");
        stringBuilder.append(hotType);
        return stringBuilder.toString();
    }

    public static String getFeedInfoUrl(long feedId) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getApiDomain());
        stringBuilder.append("/v2/feed/info");
        stringBuilder.append("?feedId=");
        stringBuilder.append(feedId);
        return stringBuilder.toString();
    }

    public static String getFeedTopicUrl(String label, int sinceId, int maxId, int count, boolean include) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getApiDomain());
        stringBuilder.append("/v2/discover/label/newest");
        stringBuilder.append("?label=");
        stringBuilder.append(Uri.encode(label));
        stringBuilder.append("&sinceId=");
        stringBuilder.append(sinceId);
        stringBuilder.append("&maxId=");
        stringBuilder.append(maxId);
        stringBuilder.append("&count=");
        stringBuilder.append(count);
        stringBuilder.append("&include=");
        stringBuilder.append(include);
        return stringBuilder.toString();
    }

    /**
     * 标签房间
     *
     * @param label
     * @return
     */
    public static String getLabelRoomsUrl(String label, int start, int count) {
        if (TextUtils.isEmpty(label)) {
            return getApiDomain() + "/v2/discover/label/rooms";
        }

        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getApiDomain());
        stringBuilder.append("/v2/discover/label/rooms");
        stringBuilder.append("?label=");
        stringBuilder.append(Uri.encode(label));
        stringBuilder.append("&start=");
        stringBuilder.append(start);
        stringBuilder.append("&count=");
        stringBuilder.append(count);
        return stringBuilder.toString();
    }


    /**
     * banner URL
     *
     * @return
     */
    public static String getBannersUrl() {
        return getApiDomain() + "/v2/info/banners";
    }

    /**
     * banner URL
     *
     * @return
     */
    public static String getAdsUrl() {
        return getApiDomain() + "/v2/info/activityAds";
    }

    /**
     * 推荐动态 URL
     *
     * @return
     */
    public static String getFeedsUrl(int sinceId, int count) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getApiDomain());
        stringBuilder.append("/v2/discover/feed/suggest");
        stringBuilder.append("?sinceId=");
        stringBuilder.append(sinceId);
        stringBuilder.append("&count=");
        stringBuilder.append(count);
        return stringBuilder.toString();
    }

    /**
     * 游戏房间 URL
     *
     * @return
     */
    public static String getRoomingameUrl(int start, int count) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getApiDomain());
        stringBuilder.append("/v2/discover/room/ingame");
        stringBuilder.append("?start=");
        stringBuilder.append(start);
        stringBuilder.append("&count=");
        stringBuilder.append(count);
        return stringBuilder.toString();
    }

    /**
     * 个人信息的动态列表
     *
     * @param targetUid
     * @param maxId
     * @param count
     * @return
     */
    public static String getProfileDynamicUrl(long targetUid, int maxId, int count) {

        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/feeds?");
        if (targetUid != 0) {
            builder.append("targetUid=").append(targetUid).append("&");
        }
        builder.append("maxId=").append(maxId).append("&");
        builder.append("count=").append(count);

        return builder.toString();
    }

    public static String getprofileSupperUrl(long targetUid, long maxId, int count) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/shortLive/list?");
        if (targetUid != 0) {
            builder.append("targetUid=").append(targetUid).append("&");
        }
        builder.append("maxId=").append(maxId);
        builder.append("&count=").append(count);
        return builder.toString();
    }

    /**
     * 个人信息的点赞动态列表
     *
     * @param targetUid
     * @param beforeTime
     * @param count
     * @return
     */
    public static String getProfileLikeDynamicUrl(long targetUid, int beforeTime, int count) {

        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/feedsLike?");
        if (targetUid != 0) {
            builder.append("targetUid=").append(targetUid).append("&");
        }
        builder.append("beforeTime=").append(beforeTime).append("&");
        builder.append("count=").append(count);

        return builder.toString();
    }

    /**
     * 修改用户信息
     *
     * @return
     */
    public static String getUpdateUserInfoUrl() {
        return getApiDomain() + "/v2/user/info/update";
    }

    /**
     * 关注他人
     *
     * @return
     */
    public static String getCreateFollowUrl() {
        return getApiDomain() + "/v2/user/relation/create";
    }

    /**
     * 取消关注
     *
     * @return
     */
    public static String getCancleFollowUrl() {
        return getApiDomain() + "/v2/user/relation/del";
    }

    /**
     * 互动通知,我的
     */
    public static String getNoticeMineUrl(int maxId, int sinceId, int count) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/event/my?");
        builder.append("maxId=").append(maxId).append("&");
        builder.append("sinceId=").append(sinceId).append("&");
        builder.append("count=").append(count);
        return builder.toString();
    }

    /**
     * 用户-获取自己关注的用户列表
     */
    public static String getMineFollowUrl(int count, long start, long uid) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/relation/follows?");
        builder.append("start=").append(start).append("&");
        builder.append("targetUid=").append(uid).append("&");
        builder.append("count=").append(count);
        return builder.toString();
    }

    /**
     * 用户-获取自己的粉丝
     */
    public static String getMineFansUrl(int count, long start, long uid) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/relation/fans?");
        builder.append("start=").append(start).append("&");
        builder.append("targetUid=").append(uid).append("&");
        builder.append("count=").append(count);
        return builder.toString();
    }

    /**
     * 微信支付
     *
     * @return
     */
    public static String getwxpayUrl() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getApiDomain());
        stringBuilder.append("/v2/pay/wxpay");
        return stringBuilder.toString();
    }

    /**
     * 支付宝支付
     *
     * @return
     */
    public static String getalipayUrl() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getApiDomain());
        stringBuilder.append("/v2/pay/alipay");
        return stringBuilder.toString();
    }

    /**
     * 充值价格列表
     *
     * @return
     */
    public static String getrechargeListUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/info/rechargeList");
        return builder.toString();
    }

    /**
     * 充值信息
     *
     * @return
     */
    public static String getrechargeInfoUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/pay/rechargeInfo");
        return builder.toString();
    }

    /**
     * 检查 身份证和姓名
     *
     * @param realName
     * @param idNum
     * @return
     */
    public static String getcheckIDcardUrl(String realName, String idNum) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/account/realName/checkIDcard");
        builder.append("?realName=").append(realName);
        builder.append("&idNum=").append(idNum);
        return builder.toString();
    }

    /**
     * 获取支付宝授权的参数
     *
     * @return
     */
    public static String getParaUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/account/realName/getPara");
        return builder.toString();
    }

    /**
     * 获取支付宝实名认证的结果
     *
     * @param realName
     * @param idNum
     * @param authCode
     * @return
     */
    public static String getverifyUrl(String realName, String idNum, String authCode) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/account/realName/verify");
        builder.append("?realName=").append(realName);
        builder.append("&idNum=").append(idNum);
        builder.append("&authCode=").append(authCode);
        return builder.toString();
    }

    /**
     * 获取实名认证状态
     *
     * @return
     */
    public static String getrealNamestatusUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/account/realName/status");
        return builder.toString();
    }

    /**
     * 提现历史记录
     *
     * @param start
     * @param count
     * @return
     */
    public static String getwithdrawListUrl(int start, int count) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/pay/withdrawList");
        builder.append("?start=").append(start);
        builder.append("&count=").append(count);
        return builder.toString();
    }

    /**
     * 模糊搜索用户
     *
     * @return
     */
    public static String getsearchuserUrl(int start, String name, int count) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/discover/search/user");
        builder.append("?start=").append(start);
        builder.append("&name=").append(Uri.encode(name));
        builder.append("&count=").append(count);
        builder.append("&deviceOs=android");
        return builder.toString();
    }

    /**
     * 模糊搜索话题
     *
     * @return
     */
    public static String getsearchlabelUrl(int start, String name, int count) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/discover/search/label");
        builder.append("?start=").append(start);
        builder.append("&name=").append(Uri.encode(name));
        builder.append("&count=").append(count);
        builder.append("&deviceOs=android");
        return builder.toString();
    }

    /**
     * 模糊推荐用户
     *
     * @return
     */
    public static String getsearchsuggestUserlUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/discover/search/suggestUser");
        return builder.toString();
    }

    /**
     * 获取房间信息
     *
     * @return
     */
    public static String getRoomInfoUrl(long roomId) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/room/info");
        builder.append("?roomId=").append(roomId);
        return builder.toString();
    }

    /**
     * 充值记录
     *
     * @param start
     * @param count
     * @return
     */
    public static String getrechargeListUrl(int start, int count) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/pay/rechargeList");
        builder.append("?start=").append(start);
        builder.append("&count=").append(count);
        return builder.toString();
    }

    /**
     * 兑换价格列表
     *
     * @return
     */
    public static String getExchangeListUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/info/exchangeList");
        return builder.toString();
    }

    /**
     * 提现信息
     *
     * @return
     */
    public static String getwithdrawInfoUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/pay/withdrawInfo");
        return builder.toString();
    }

    /**
     * 提现信息
     *
     * @return
     */
    public static String getIncomeInfoUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/stat/income");
        return builder.toString();
    }

    /**
     * 提交大V认证
     *
     * @return
     */
    public static String getvipsubmitUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/account/largeVip/submit");
        return builder.toString();
    }

    /**
     * 提交提现申请
     *
     * @return
     */
    public static String getpaywithdrawUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/pay/withdraw");
        return builder.toString();
    }

    /**
     * 确认签约
     * confirmSign
     *
     * @return
     */
    public static String getconfirmSignUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/pay/confirmSign");
        return builder.toString();
    }

    /**
     * 提交实名认证
     */
    public static String getRealNameSubmitUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/account/realName/submit");

        return builder.toString();
    }

    /**
     * 兑换(魅力->魅钻)
     *
     * @return
     */
    public static String getExchangeUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/pay/exchange");
        return builder.toString();
    }

    /**
     * 互动通知,我关注的
     */
    public static String getNoticeMineFollowUrl(int maxId, int sinceId, int count) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/event/myFollow?");
        builder.append("maxId=").append(maxId).append("&");
        builder.append("sinceId=").append(sinceId).append("&");
        builder.append("count=").append(count);
        return builder.toString();
    }

    /**
     * 发现排行榜
     */
    public static String getDiscoverRankingUrl(String rankType, String rankInTime, int count, int start) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/discover/rank?");
        builder.append("rankType=").append(rankType).append("&");
        builder.append("rankInTime=").append(rankInTime).append("&");
        builder.append("count=").append(count).append("&");
        builder.append("start=").append(start);
        return builder.toString();
    }

    /**
     * 个人页收礼排行榜
     */
    public static String getProfileGetGiftRankingUrl(long targetUid, int count, int start) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/gift/gainList?");
        if (targetUid != 0) {
            builder.append("targetUid=").append(targetUid).append("&");
        }
        builder.append("count=").append(count).append("&");
        builder.append("start=").append(start);
        return builder.toString();
    }

    /**
     * 个人页送礼
     */
    public static String getProfileSendGiftRankingUrl(long maxId, int count) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/gift/sendList?");
        builder.append("count=").append(count).append("&");
        builder.append("maxId=").append(maxId);
        return builder.toString();
    }

    /**
     * 系统通知
     */
    public static String getSystemNoticeUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/mailList?");
        return builder.toString();
    }

    //房间7天礼物排行榜
    public static String getRoomRankingUrl(long roomId) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/room/rank?");
        builder.append("roomId=").append(roomId);
        return builder.toString();
    }

    //房间礼物排行榜
    public static String getRoomRankingListUrl(long roomId, int rankType) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/room/rankList?");
        builder.append("roomId=").append(roomId);
        builder.append("&rankType=").append(rankType);
        return builder.toString();
    }

    //所有礼物
    public static String requestGiftList(int getType, int giftType) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/info/giftsList?");
        builder.append("getType=").append(getType);
        builder.append("&giftType=").append(giftType);
        return builder.toString();
    }

    /**
     * 我的合并消息
     */
    public static String getMineNoticeMergeUrl(long messageId) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/event/myDetail?");
        builder.append("messageId=").append(messageId);
        return builder.toString();
    }

    /**
     * 我关注的合并消息
     */
    public static String getMineFollowNoticeMergeUrl(long messageId) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/event/myFollowDetail?");
        builder.append("messageId=").append(messageId);
        return builder.toString();
    }

    /**
     * 绑定手机
     */
    public static String getBindPhoneUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/account/bindPhone");
        return builder.toString();
    }

    /**
     * 推荐
     */
    public static String getSuggestUrl(int count) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/discover/user/suggest?");
        builder.append("count=").append(count);
        return builder.toString();
    }

    /**
     * 个人页-系统消息-消息详情
     */
    public static String getMailRecordUrl(int contentType, int count, long maxId) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/mailRecord?");
        builder.append("contentType=").append(contentType).append("&");
        builder.append("count=").append(count).append("&");
        builder.append("maxId=").append(maxId);
        return builder.toString();
    }

    /**
     * 系统消息-忽略未读
     *
     * @return
     */
    public static String getMailIgnoreUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/mailIgnore");
        return builder.toString();
    }

    /**
     * 系统消息-删除
     *
     * @return
     */
    public static String getMailDeleteUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/mailDelete");
        return builder.toString();
    }

    /**
     * 系统消息红点
     *
     * @return
     */
    public static String getSysRedPointUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/sysRedPoint?");
        return builder.toString();
    }

    /**
     * 发送私信
     *
     * @return
     */
    public static String getSendMessageUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/personalMail/send");
        return builder.toString();
    }

    /**
     * 获取私信列表
     *
     * @return
     */
    public static String getRecentContactUrl(int listOffset, int count) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/personalMail/list?");
        builder.append("listOffset=").append(listOffset).append("&");
        builder.append("count=").append(count);
        return builder.toString();
    }

    /**
     * 获取私信记录列表
     *
     * @return
     */
    public static String getMessageListUrl(long yourUid, int listOffset, int count) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/personalMail/record?");
        builder.append("yourUid=").append(yourUid).append("&");
        builder.append("recordOffset=").append(listOffset).append("&");
        builder.append("count=").append(count);
        return builder.toString();
    }

    /**
     * 帮助
     *
     * @return
     */
    public static String getHelpUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/info/helps?");
        return builder.toString();
    }

    /**
     * 删除私信列表
     *
     * @return
     */
    public static String getDeleteRecentContactUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/personalMail/delete");
        return builder.toString();
    }

    /**
     * 反馈
     *
     * @return
     */
    public static String getFeedbackUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/feedback");
        return builder.toString();
    }

    /**
     * 获取推送设置
     *
     * @return
     */
    public static String getPushConfigUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/config/push?");
        return builder.toString();
    }

    /**
     * 修改推送设置
     *
     * @return
     */
    public static String getSetPushConfigUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/config/setPush");
        return builder.toString();
    }

    /**
     * 修改推送设置
     *
     * @return
     */
    public static String getAgreementsUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/info/agreements?");
        return builder.toString();
    }

    /**
     * 查看特权
     *
     * @return
     */
    public static String getPermissionUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/info/exp?");
        return builder.toString();
    }

    /**
     * 等级规则
     *
     * @return
     */
    public static String getPermissionRuleUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/info/levels?");
        return builder.toString();
    }

    /**
     * 私信设为已读
     *
     * @return
     */
    public static String getRecentContactReadedUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/personalMail/readed");
        return builder.toString();
    }

    /**
     * 服务器地址
     *
     * @return
     */
    public static String getServerUrl() {
        return "http://120.76.207.238:7999/v2/info/servers";
    }


    //直播公告
    public static String getRoomTipsUrl() {
        return getApiDomain() + "/config/room/enter/tips?TipsType=2";
    }


    //获取视频缩略图
    public static String getVideoThumbUrl(String url) {
        return url + "?vframe/jpg/offset/0/h/360|imageslim";
    }

    /**
     * 话题链接
     *
     * @param label
     * @param nickName
     * @return
     */
    public static String getShareDynamicsLabelUrl(String label, String nickName) {
        return getShareDomain() + "/share/topic?LabelContent=" + Uri.encode(label) + "&Nick=" + Uri.encode(nickName) + getShareScheme();
    }

    /**
     * 动态分享链接
     *
     * @param feedId
     * @return
     */
    public static String getShareDynamicsUrl(long feedId) {
        return getShareDomain() + "/share/feed?FeedId=" + feedId + getShareScheme();
    }

    //直播分享链接
    public static String getShareLiveUrl(long roomId) {
        return getShareDomain() + "/share.html?room_id=" + roomId + getShareScheme();
    }

    //超胆播分享链接
    public static String getShareShortLiveUrl(long shortLiveId) {
        return getShareDomain() + "/Share/superLive?shortLiveId=" + shortLiveId + getShareScheme();
    }

    //分享链接scheme参数
    private static String getShareScheme() {
        return "&scheme=" + SCHEME + "&host=" + HOST;
    }

    //获取http地址
    public static String getServerHost() {
        return getApiDomain();
    }

    /**
     * 忽略未读私信
     *
     * @return
     */
    public static String getPersonalMailIgnoreUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/personalMail/ignore");
        return builder.toString();
    }

    /**
     * 删除私信
     *
     * @return
     */
    public static String getDeleteRecordUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/user/personalMail/deleteRecord");
        return builder.toString();
    }

    //短直播开播
    public static String getStartShortLiveUrl() {
        return getApiDomain() + "/v2/shortLive/start";
    }

    //短直播开播(自定义题目)
    public static String getSetChallengeUrl() {
        return getApiDomain() + "/v2/shortLive/setTopic";
    }

    //观看短直播
    public static String getNextShortLiveUrl(long lastShortLiveId, long targetShortLiveId, long targetUid) {
        return getApiDomain() + "/v2/shortLive/viewNext?shortLiveId=" + lastShortLiveId + "&nextShortLiveId=" + targetShortLiveId + "&targetUid=" + targetUid;
    }

    //短直播完成
    public static String getFinishShortLiveUrl() {
        return getApiDomain() + "/v2/shortLive/finish";
    }

    //短直播完成
    public static String getCancelShortLiveUrl() {
        return getApiDomain() + "/v2/shortLive/cancel";
    }

    //短直播放弃
    public static String getAbortShortLiveUrl() {
        return getApiDomain() + "/v2/shortLive/abort";
    }

    //短视频观看结束
    public static String getViewEndShortLiveUrl() {
        return getApiDomain() + "/v2/shortLive/viewEnd";
    }

    /**
     * 我的挑战信息
     *
     * @return
     */
    public static String getMyShortLiveInfoUrl(long targetUid) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/shortLive/myInfo?");
        builder.append("targetUid=").append(targetUid);
        return builder.toString();
    }

    /**
     * BGM
     *
     * @return
     */
    public static String getMusicListUrl(int musicType) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/info/musicList?");
        builder.append("musicType=").append(musicType);
        return builder.toString();
    }

    /**
     * 系统参数
     *
     * @return
     */
    public static String getSysParam(String config) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/info/sysparam?");
        builder.append("paramKey=").append(config);
        return builder.toString();
    }

    /**
     * 游戏排行榜
     *
     * @return
     */
    public static String getGameRanking() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/discover/gameRank");
        return builder.toString();
    }

    /**
     * 查询活动开关状态
     *
     * @return
     */
    public static String getSysparamUrl(String paramKey) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/info/sysparam?");
        builder.append("paramKey=");
        builder.append(paramKey);
        return builder.toString();
    }

    //观看主题短直播
    public static String getNextTopicShortLiveUrl(long shortLiveId, long nextShortLiveId, long topicId, int type) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/shortLive/topicViewNext?");
        builder.append("shortLiveId=");
        builder.append(shortLiveId);
        builder.append("&nextShortLiveId=");
        builder.append(nextShortLiveId);
        builder.append("&topicId=");
        builder.append(topicId);
        builder.append("&type=");
        builder.append(type);
        return builder.toString();
    }

    //观看家族短直播
    public static String getNextFamilyShortLiveUrl(long shortLiveId, long nextShortLiveId, long familyId) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/shortLive/familyViewNext?");
        builder.append("shortLiveId=");
        builder.append(shortLiveId);
        builder.append("&nextShortLiveId=");
        builder.append(nextShortLiveId);
        builder.append("&familyId=");
        builder.append(familyId);
        return builder.toString();
    }

    // 获取召唤主播的用户列表
    public static String getcallLiveUrl(long targetUid, int count, int maxId) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getApiDomain());
        stringBuilder.append("/v2/user/callLive/list");
        stringBuilder.append("?targetUid=");
        stringBuilder.append(targetUid);
        stringBuilder.append("&count=");
        stringBuilder.append(count);
        stringBuilder.append("&maxId=");
        stringBuilder.append(maxId);
        return stringBuilder.toString();
    }

    // 召唤主播开播
    public static String getMakeLiveUrl() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getApiDomain());
        stringBuilder.append("/v2/user/callLive");
        return stringBuilder.toString();
    }

    /**
     * 获取挑战题目信息
     *
     * @return
     */
    public static String getTopicUrl(long topicId) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/shortLive/topicInfo");
        builder.append("?topicId=").append(topicId);
        return builder.toString();
    }

    /**
     * 发现页栏目列表
     *
     * @return
     */
    public static String getColumnsUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/info/columns");
        return builder.toString();
    }

    /**
     * === 家族 ===
     */
    /**
     * === 创建家族 ===
     */
    public static String createFamilyUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/familyCreate");
        return builder.toString();
    }

    /**
     * 修改家族
     *
     * @return
     */
    public static String modifyFamilyUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/familyEdit");
        return builder.toString();
    }

    /**
     * 申请加入家族
     *
     * @return
     */
    public static String joinFamilyUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/familyJoin");
        return builder.toString();
    }

    /**
     * 离开家族
     *
     * @return
     */
    public static String getFamilyLeaveUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/familyLeave");
        return builder.toString();
    }

    /**
     * 获取家族系统个人信息
     *
     * @return
     */
    public static String getImUserInfoUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/getUserInfo");
        return builder.toString();
    }

    /**
     * 获取家族系统个人信息
     *
     * @return
     */
    public static String searchFamilyUrl(String name, int start, int count) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/search");
        builder.append("?name=").append(name);
        builder.append("&start=").append(start);
        builder.append("&count=").append(count);
        return builder.toString();
    }

    /**
     * 推荐家族
     *
     * @param start
     * @param count
     * @return
     */
    public static String getSuggestFamilyUrl(int start, int count) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/suggest");
        builder.append("?start=").append(start);
        builder.append("&count=").append(count);
        return builder.toString();
    }

    /**
     * 根据uid查询家族信息
     *
     * @param targetUid
     * @return
     */
    public static String getFamilyInfoByUidUrl(long targetUid) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/getUserInfo");
        builder.append("?targetUid=").append(targetUid);
        return builder.toString();
    }

    /**
     * 获取家庭的用户
     *
     * @param familyId
     * @param start
     * @param count
     * @return
     */
    public static String getFamilyUsersUrl(int familyId, int start, int count) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/members");
        builder.append("?familyId=").append(familyId);
        builder.append("&start=").append(start);
        builder.append("&count=").append(count);
        return builder.toString();
    }

    /**
     * 获取家族的申请人员列表
     *
     * @param familyId
     * @return
     */
    public static String getFamilyAcceptUsersUrl(int familyId) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/getJoinApply");
        builder.append("?familyId=").append(familyId);
        return builder.toString();
    }

    /**
     * 家族成员审核
     *
     * @return
     */
    public static String getCheckJoinApplyUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/checkJoinApply");
        return builder.toString();
    }

    /**
     * 目标用户id
     *
     * @return
     */
    public static String getUserManagementUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/userManagement");
        return builder.toString();
    }

    /**
     * 获取家族经验配置
     *
     * @return
     */
    public static String getExpConfigUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/getExpConfig");
        return builder.toString();
    }

    /**
     * 获取直播列表
     *
     * @param start
     * @param count
     * @return
     */
    public static String getFamilyLiveUrl(int start, int count, int familyid) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/liveRooms");
        builder.append("?start=").append(start);
        builder.append("&count=").append(count);
        builder.append("&familyId=").append(familyid);
        return builder.toString();
    }


    /**
     * 获取家族动态
     *
     * @param start
     * @param count
     * @param familyid
     * @return
     */
    public static String getFamilyFeedUrl(int start, int count, int familyid, int firstGet) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/feeds");
        builder.append("?maxId=").append(start);
        builder.append("&count=").append(count);
        builder.append("&familyId=").append(familyid);
        builder.append("&firstGet=").append(firstGet);
        return builder.toString();
    }

    /**
     * 家族超胆播列表
     *
     * @param start
     * @param count
     * @param familyid
     * @return
     */
    public static String getFamilySupperLiveUrl(int start, int count, int familyid,int firstGet) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/shortLives");
        builder.append("?start=").append(start);
        builder.append("&count=").append(count);
        builder.append("&familyId=").append(familyid);
        builder.append("&firstGet=").append(firstGet);
        return builder.toString();
    }

    /**
     * 家族贡献榜
     *
     * @return
     */
    public static String getFamilyRankUrl(int familyId, String rankInTime, int count, int start) {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/rank");
        builder.append("?familyId=").append(familyId);
        builder.append("&rankInTime=").append(rankInTime);
        builder.append("&count=").append(count);
        builder.append("&start=").append(start);
        return builder.toString();
    }

    /**
     * 聊天权限
     *
     * @return
     */
    public static String getSyncSettingUrl() {
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/family/syncSetting");
        return builder.toString();
    }

    /**
     * 查询活动开关状态
     * 一次查询多个
     * @return
     */
    public static String getSysparamsUrl(String... paramKey) {
        StringBuilder paramsbuilder = new StringBuilder();
        for (int i = 0; i < paramKey.length; i++) {
            if (i ==paramKey.length-1){
                paramsbuilder.append(paramKey[i]);
            }else{
                paramsbuilder.append(paramKey[i]).append(",");
            }
        }
        StringBuilder builder = new StringBuilder();
        builder.append(getApiDomain()).append("/v2/info/sysparams?");
        builder.append("paramKeys=");
        builder.append(paramsbuilder.toString());
        return builder.toString();
    }
}
